/*************************************************************************
 * File Name:    D.cc
 * Author:       zero91
 * Mail:         jianzhang9102@gmail.com
 * Created Time: Sat 12 Oct 2013 10:15:33 AM CST
 * 
 * Description:  
 ************************************************************************/

#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>

using namespace std;

#define MAXN 120

const int move[4][2] = {{0, -1}, {0, 1}, {1, 0}, {-1, 0}};
int matrix[MAXN][MAXN], steps[MAXN][MAXN];
int move_value[MAXN][MAXN];
bool visited[MAXN][MAXN];
int N, M;

int
bfs(int enx, int eny, int exx, int exy)
{
    queue<int> Q;
    int x, y, tx, ty;

    memset(visited, false, sizeof(visited));
    memset(steps, -1, sizeof(steps));
    memset(move_value, -1, sizeof(move_value));

    Q.push(enx);
    Q.push(eny);
    visited[enx][eny] = true;
    steps[enx][eny] = 0;
    move_value[enx][eny] = matrix[enx][eny];

    while (!Q.empty()) {
        x = Q.front(), Q.pop();
        y = Q.front(), Q.pop();

        for (size_t i = 0; i < sizeof(move) / sizeof(move[0]); ++i) {
            tx = x + move[i][0];
            ty = y + move[i][1];
            if (tx < 0 || tx >= N || ty < 0 || ty >= M) continue;
            if (matrix[tx][ty] < 0) continue;
            if (visited[tx][ty]) {
                if (steps[tx][ty] == steps[x][y] + 1) {
                    move_value[tx][ty] = max(move_value[tx][ty], move_value[x][y] + matrix[tx][ty]);
                }
                continue;
            }
            Q.push(tx);
            Q.push(ty);
            steps[tx][ty] = steps[x][y] + 1;
            move_value[tx][ty] = move_value[x][y] + matrix[tx][ty];
            visited[tx][ty] = true;
        }
    }
    if (steps[exx][exy] < 0) return -1;

    return move_value[exx][exy];
}

int
main(int argc, char *argv[])
{
    //std::ios_base::sync_with_stdio(false);

    int T;
    int enx, eny, exx, exy, ans;

    cin >> T;
    for (int k = 1; k <= T; ++k) {
        cin >> N >> M;
        cin >> enx >> eny >> exx >> exy;
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < M; ++j) {
                cin >> matrix[i][j];
            }
        }
        ans = bfs(enx, eny, exx, exy);
        if (ans < 0) cout << "Case #" << k << ": " << "Mission Impossible." << endl;
        else cout << "Case #" << k << ": " << ans << endl;
    }

    return 0;
}
